<?php


namespace app\controller\v1;


use app\model\CommodityOrder;
use think\Request;

/**
 * 订单
 * Class Order
 * @package app\controller\v1
 */
class Order
{


    /**
     * Order constructor.
     * @param CommodityOrder $order
     */
    public function __construct(CommodityOrder $order)
    {
        $this->model = $order;
    }

    /**
     * 订单列表
     * @param Request $request
     * @return mixed
     * @throws \think\db\exception\DbException
     */
    public function OrderList(Request $request)
    {
        return $this->model->OrderList($request->data);
    }


    /**
     * 下单信息
     * @param Request $request
     * @return mixed
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function payMsg(Request $request)
    {
        return $this->model->payMsg($request->data);
    }


    /**
     * 下单
     * @param Request $request
     * @return mixed
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function pay(Request $request)
    {
        return $this->model->Pay($request);
    }

    /**
     * 秒杀
     * @param Request $request
     * @return mixed
     */
    public function Spike(Request $request)
    {
        return $this->model->Spike($request);
    }


    /**
     * 确认收货
     * @param Request $request
     * @return mixed
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function OrderModify(Request $request)
    {
        return $this->model->OrderModify($request->data);
    }

    //物流接口
    public function Logistics(Request $request)
    {
        return $this->model->logistics($request->data);
    }


    public function OrderAddress(Request $request){
        return $this->model->OrderAddress($request->data);
    }

}